<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<form th:action="@{/haha}" method="post">
    <label>用户名</label><input type="text" placeholder="请输入用户名" name="uname">

    <br/>

    <label>密码</label><input type="password" placeholder="请输入密码" name="pwd">

    <label>验证码</label><input type="text" name="verifyCode" id="verifyCode" placeholder="请输入验证码"/>
        <img id="showImgCode" title="看不清？点击换一张！" th:src="@{/verifyCode/gen}" style="cursor: pointer;" onclick="refreshImage();"/>

    <br/>
    <input type="checkbox" name="rmb">自动登录
    <input type="submit" name="提交">

    <p style="color: red" id="security_msg" th:if="${param.error}">
        <span th:if="${session['SPRING_SECURITY_LAST_EXCEPTION']}" th:text="${session['SPRING_SECURITY_LAST_EXCEPTION'].message}"></span>
    </p>
</form>

<div>
    <!-- 登出带 http://127.0.0.1:8080/myLoginPage?logout 的?logout 能进行回显判断param.logout-->
    <span th:if="${param.logout}">fefe</span>
</div>

</body>
<script type="text/javascript">
    function refreshImage(){
        document.getElementById("showImgCode").setAttribute("src","/verifyCode/gen?timestamp="+(new Date().getTime()));
    }
</script>
</html>